<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="layui/css/layui.css">

</head>

<body>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <a href="#" class="layui-border-box site-doc-icon site-doc-anim">连接</a>
        </div>
    </div>
    <div class="layui-btn-container">
        <button class="layui-btn layui-btn-normal layui-btn-sm" onclick="getCheckData()">蓝鸥</button>
        <button class="layui-btn layui-btn-sm layui-btn-danger" onclick ="getCheckLength()">百度一下</button>
        <button class="layui-btn layui-btn-sm layui-btn-warm" onclick="isAll()">京东商城</button>
      </div>
    <script src="layui/layui.js"></script>
    <script>

        var a = document.getElementsByTagName('a')[0];
        console.log(a);
        function getCheckData() {
            a.href = "http://www.lanou3g.com/";
            a.innerText = '蓝鸥';
        }

        function getCheckLength() {
            a.href = "http://www.baidu.com/";
            a.innerText = '百度一下';
        }


        function isAll() {
            a.href = "http://www.jd.com//";
            a.innerText = '京东商城';
        }
    </script>
</body>

</html>